﻿namespace WMS6.Web.Analytics
{
    using System;
    using System.Web.UI;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.WebControls;
    using WMS6.Web;

    public class WarehouseTransferRptQuery : BasePage
    {
        protected Button btnSearch;
        protected CheckBox ckbActualShipDate;
        protected CheckBox ckbShowLot;
        protected DropDownList ddlActualShipDate;
        protected DropDownList ddlDestWhDBID;
        protected DropDownList ddlDestWhDBIDOper;
        protected DropDownList ddlExpiryDateOper;
        protected DropDownList ddlIntransitID;
        protected DropDownList ddlLotAttribute01;
        protected DropDownList ddlLotAttribute02;
        protected DropDownList ddlLotAttribute03;
        protected DropDownList ddlLotAttribute04;
        protected DropDownList ddlLotAttribute05;
        protected DropDownList ddlLotAttribute06;
        protected DropDownList ddlLotAttribute07;
        protected DropDownList ddlLotAttribute08;
        protected DropDownList ddlLotAttribute09;
        protected DropDownList ddlLotAttribute10;
        protected DropDownList ddlOrderID;
        protected DropDownList ddlOwnerID;
        protected DropDownList ddlProduceDateOper;
        protected DropDownList ddlReceiptID;
        protected DropDownList ddlSku;
        protected DropDownList ddlSkuClassID;
        protected DropDownList ddlSkuDescr;
        protected DropDownList ddlSrcWhDBID;
        protected DropDownList ddlSrcWhDBIDOpr;
        protected HtmlForm F13810;
        protected HtmlInputHidden hdnActionID;
        protected HtmlInputHidden hdncalendarFlag;
        protected HtmlInputHidden hdnDataFormat;
        protected HtmlHead Head1;
        protected HtmlImage img1;
        protected HtmlImage img2;
        protected HtmlImage img3;
        protected Label lblActualShipDate;
        protected Label lblDestWhDBID;
        protected Label lblExpiryDate;
        protected Label lblIntransitID;
        protected Label lblLotAttribute02;
        protected Label lblLotAttribute03;
        protected Label lblLotAttribute04;
        protected Label lblLotAttribute05;
        protected Label lblLotAttribute06;
        protected Label lblLotAttribute07;
        protected Label lblLotAttribute08;
        protected Label lblLotAttribute09;
        protected Label lblLotAttribute1;
        protected Label lblLotAttribute10;
        protected Label lblOrderID;
        protected Label lblOwnerID;
        protected Label lblProduceDate;
        protected Label lblReceiptID;
        protected Label lblSku;
        protected Label lblSkuClassID;
        protected Label lblSkuDescr;
        protected Label lblSrcWhDBID;
        protected HtmlLink mycss;
        protected Label one1;
        protected Label one2;
        protected ScriptManager ScriptManager1;
        protected TextBox txtActualShipDate;
        protected TextBox txtExpiryDate;
        protected TextBox txtIntransitID;
        protected TextBox txtLotAttribute01;
        protected TextBox txtLotAttribute02;
        protected TextBox txtLotAttribute03;
        protected TextBox txtLotAttribute04;
        protected TextBox txtLotAttribute05;
        protected TextBox txtLotAttribute06;
        protected TextBox txtLotAttribute07;
        protected TextBox txtLotAttribute08;
        protected TextBox txtLotAttribute09;
        protected TextBox txtLotAttribute10;
        protected TextBox txtOrderID;
        protected TextBox txtOwnerID;
        protected TextBox txtProduceDate;
        protected TextBox txtReceiptID;
        protected TextBox txtSku;
        protected TextBox txtSkuClassID;
        protected TextBox txtSkuDescr;

        protected void btnSearch_Click(object sender, EventArgs e)
        {
            base.Server.Transfer("WarehouseTransferRptList.aspx", false);
        }

        private void LoadDDl()
        {
            base.InitQueryDDL(this.ddlIntransitID, 0);
            base.InitQueryDDL(this.ddlSrcWhDBIDOpr, 0);
            base.InitQueryDDL(this.ddlDestWhDBIDOper, 0);
            base.InitQueryDDL(this.ddlActualShipDate, 1);
            base.BindData2DDL4WareHouse(this.ddlSrcWhDBID);
            base.BindData2DDL4WareHouse(this.ddlDestWhDBID);
            this.ddlDestWhDBID.Items.Insert(0, new ListItem("", ""));
            this.ddlSrcWhDBID.Items.Insert(0, new ListItem("", ""));
            base.InitQueryDDL(this.ddlOwnerID, 0);
            base.InitQueryDDL(this.ddlOrderID, 0);
            base.InitQueryDDL(this.ddlReceiptID, 0);
            base.InitQueryDDL(this.ddlSku, 0);
            base.InitQueryDDL(this.ddlSkuClassID, 0);
            base.InitQueryDDL(this.ddlSkuDescr, 0);
            base.InitQueryDDL(this.ddlProduceDateOper, 1);
            base.InitQueryDDL(this.ddlExpiryDateOper, 1);
            base.InitQueryDDL(this.ddlLotAttribute01, 0);
            base.InitQueryDDL(this.ddlLotAttribute02, 0);
            base.InitQueryDDL(this.ddlLotAttribute03, 0);
            base.InitQueryDDL(this.ddlLotAttribute04, 0);
            base.InitQueryDDL(this.ddlLotAttribute05, 0);
            base.InitQueryDDL(this.ddlLotAttribute06, 0);
            base.InitQueryDDL(this.ddlLotAttribute07, 0);
            base.InitQueryDDL(this.ddlLotAttribute08, 0);
            base.InitQueryDDL(this.ddlLotAttribute09, 0);
            base.InitQueryDDL(this.ddlLotAttribute10, 0);
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!base.IsPostBack)
            {
                base.InitPage(this.Page);
                this.LoadDDl();
            }
        }

        public string ActualShipDate
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtActualShipDate.Text.Trim()))
                {
                    return base.GetParamsString(this.txtActualShipDate.Text.Trim(), this.ddlActualShipDate.SelectedValue);
                }
                return "";
            }
        }

        public string DestWhDBID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.ddlDestWhDBID.SelectedValue))
                {
                    return base.GetParamsString(this.ddlDestWhDBID.SelectedValue, this.ddlDestWhDBIDOper.SelectedValue);
                }
                return "";
            }
        }

        public string ExpiryDate
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtExpiryDate.Text.Trim()))
                {
                    return base.GetParamsString(this.txtExpiryDate.Text, this.ddlExpiryDateOper.SelectedValue);
                }
                return "";
            }
        }

        public string IntransitID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtIntransitID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtIntransitID.Text.Trim(), this.ddlIntransitID.SelectedValue);
                }
                return "";
            }
        }

        public string LotAttribute01
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtLotAttribute01.Text.Trim()))
                {
                    return base.GetParamsString(this.txtLotAttribute01.Text.Trim(), this.ddlLotAttribute01.SelectedValue);
                }
                return "";
            }
        }

        public string LotAttribute02
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtLotAttribute02.Text.Trim()))
                {
                    return base.GetParamsString(this.txtLotAttribute02.Text.Trim(), this.ddlLotAttribute02.SelectedValue);
                }
                return "";
            }
        }

        public string LotAttribute03
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtLotAttribute03.Text.Trim()))
                {
                    return base.GetParamsString(this.txtLotAttribute03.Text.Trim(), this.ddlLotAttribute03.SelectedValue);
                }
                return "";
            }
        }

        public string LotAttribute04
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtLotAttribute04.Text.Trim()))
                {
                    return base.GetParamsString(this.txtLotAttribute04.Text.Trim(), this.ddlLotAttribute04.SelectedValue);
                }
                return "";
            }
        }

        public string LotAttribute05
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtLotAttribute05.Text.Trim()))
                {
                    return base.GetParamsString(this.txtLotAttribute05.Text.Trim(), this.ddlLotAttribute05.SelectedValue);
                }
                return "";
            }
        }

        public string LotAttribute06
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtLotAttribute06.Text.Trim()))
                {
                    return base.GetParamsString(this.txtLotAttribute06.Text.Trim(), this.ddlLotAttribute06.SelectedValue);
                }
                return "";
            }
        }

        public string LotAttribute07
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtLotAttribute07.Text.Trim()))
                {
                    return base.GetParamsString(this.txtLotAttribute07.Text.Trim(), this.ddlLotAttribute07.SelectedValue);
                }
                return "";
            }
        }

        public string LotAttribute08
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtLotAttribute08.Text.Trim()))
                {
                    return base.GetParamsString(this.txtLotAttribute08.Text.Trim(), this.ddlLotAttribute08.SelectedValue);
                }
                return "";
            }
        }

        public string LotAttribute09
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtLotAttribute09.Text.Trim()))
                {
                    return base.GetParamsString(this.txtLotAttribute09.Text.Trim(), this.ddlLotAttribute09.SelectedValue);
                }
                return "";
            }
        }

        public string LotAttribute10
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtLotAttribute10.Text.Trim()))
                {
                    return base.GetParamsString(this.txtLotAttribute10.Text.Trim(), this.ddlLotAttribute10.SelectedValue);
                }
                return "";
            }
        }

        public string OrderID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtOrderID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtOrderID.Text.Trim(), this.ddlOrderID.SelectedValue);
                }
                return "";
            }
        }

        public string OwnerID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtOwnerID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtOwnerID.Text.Trim(), this.ddlOwnerID.SelectedValue);
                }
                return "";
            }
        }

        public string ProduceDate
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtProduceDate.Text.Trim()))
                {
                    return base.GetParamsString(this.txtProduceDate.Text, this.ddlProduceDateOper.SelectedValue);
                }
                return "";
            }
        }

        public string ReceiptID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtReceiptID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtReceiptID.Text.Trim(), this.ddlReceiptID.SelectedValue);
                }
                return "";
            }
        }

        public string ShowDate
        {
            get
            {
                if (this.ckbActualShipDate.Checked)
                {
                    return "Y";
                }
                return "N";
            }
        }

        public string ShowLot
        {
            get
            {
                if (this.ckbShowLot.Checked)
                {
                    return "Y";
                }
                return "N";
            }
        }

        public string SkuClassID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtSkuClassID.Text.Trim()))
                {
                    return base.GetParamsString(this.txtSkuClassID.Text.Trim(), this.ddlSkuClassID.SelectedValue);
                }
                return "";
            }
        }

        public string SkuDescr
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtSkuDescr.Text.Trim()))
                {
                    return base.GetParamsString(this.txtSkuDescr.Text.Trim(), this.ddlSkuDescr.SelectedValue);
                }
                return "";
            }
        }

        public string SkuID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.txtSku.Text.Trim()))
                {
                    return base.GetParamsString(this.txtSku.Text.Trim(), this.ddlSku.SelectedValue);
                }
                return "";
            }
        }

        public string SrcWhDBID
        {
            get
            {
                if (!string.IsNullOrEmpty(this.ddlSrcWhDBID.SelectedValue))
                {
                    return base.GetParamsString(this.ddlSrcWhDBID.SelectedValue, this.ddlSrcWhDBIDOpr.SelectedValue);
                }
                return "";
            }
        }
    }
}

